﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PolePosition.v3.Desktop.Editors
{
    public partial class EditXmissionGpsVisit : DialogBase, IDialogBase
    {
        public EditXmissionGpsVisit(bool IsEdit, EntityLibrary.VendorVisitXMissionStructuresPoleEntity data)
        {
            InitializeComponent();


            m_IsEdit = IsEdit;
            Data = data;

            if (IsEdit)
                base.buttonXOk.Text = "Save";
            else
                base.buttonXOk.Text = "Ok";

            images1.Dock = DockStyle.Fill;
            images1.LoadImages(data.Vendor_Visit_XMissionStructures_PoleId.Value, PolePosition.v3.Common.Enumerations.DataTypes.ProjectsXmissionGpsVisit);
            xMissonPole1.Dock = DockStyle.Fill;
            xMissonPole1.EditAllowed = IsEdit;
            xMissonPole1.Data = data;
            xMissonPole1.BringToFront();
        }

        private bool m_IsEdit;

        public EntityLibrary.VendorVisitXMissionStructuresPoleEntity Data { get; set; }

        #region Asynch Processing (Implements IDialogBase)

        //to start the asynch background worker call - base.StartAsynchWork()

        public override void DoAsynchWork(DoWorkEventArgs e)
        {
            //do whatever needs to be done asynch here (BackgroudWorker_DoWork)


        }

        public override void AsychWorkComplete(object sender, RunWorkerCompletedEventArgs e)
        {
            base.AsychWorkComplete(sender, e);
            //do whatever needs to be done after asynch work complete (BackgroudWorker_RunWorkerCompleted)


        }


        #endregion

        private void buttonItemImages_Click(object sender, EventArgs e)
        {
            images1.BringToFront();
        }

        private void buttonItemTransmission_Click(object sender, EventArgs e)
        {
            xMissonPole1.BringToFront();
        }


    }
}
